home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Varsity Update 1998 August
/
SGI Varsity Update 1998 August.iso
/
dist
/
dist6.5
/
il_dev.idb
/
usr
/
include
/
il
/
ilHwManager.h.z
/
ilHwManager.h
Wrap
C/C++ Source or Header
|
1998-07-29
|
5KB
|
148 lines
#if 0
Copyright (c) 1995 SGI All Rights Reserved
THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI
The copyright notice above does not evidence any
actual or intended publication of such source code,
and is an unpublished work by Silicon Graphics, Inc.
This material contains CONFIDENTIAL INFORMATION that
is the property of Silicon Graphics, Inc. Any use,
duplication or disclosure not specifically authorized
by Silicon Graphics is strictly prohibited.
RESTRICTED RIGHTS LEGEND:
Use, duplication or disclosure by the Government is
subject to restrictions as set forth in subdivision
(c)(1)(ii) of the Rights in Technical Data and Computer
Software clause at DFARS 52.227-7013, and/or in similar
or successor clauses in the FAR, DOD or NASA FAR
Supplement. Unpublished- rights reserved under the
Copyright Laws of the United States. Contractor is
SILICON GRAPHICS, INC., 2011 N. Shoreline Blvd.,
Mountain View, CA 94039-7311
#endif
#ifndef _ilHwManager_h_
#define _ilHwManager_h_
/*
ilMpManager's for h/w acceleration; ilHwManager is a base class for
various types of h/w accelerated rendering. This header file includes
a couple of miscellaneous managers for fillTile and qBarrier ops.
*/
#include <il/ilMpManager.h>
#include <il/ilHwBarrier.h>
#include <ifl/iflTile.h>
class ilFrameBufferImg;
class ilHwContext;
class ilHwImg;
// ilHwManager implements graphics hardware operations on ilFrameBufferImgs.
// Typically these operations are broken down into portions called requests.
// An ilHwManager organizes those requests by storing information common to
// all the requests and providing a synchronization point to determine when
// all the requests have completed (see ilMpManager.h for more information
// on the MP architechture). ilHwManager's exist to perform swap buffers,
// fill areas with specified RGB values and draw image data.
//
class ilHwManager : public ilMpManager {
public:
// Construct ilMpManager node and link it under the specified parent
// ilMpNode. Record the ilFrameBufferImg we're going to be operating
// on and extract some information from it that we'll need close at
// hand.
//
ilHwManager(ilHwImg* img, ilMpNode* parent=NULL, int enables=0);
// override go() to close force barrier if present
virtual void go();
// Information common to all ilHwManagers:
//
ilHwImg* hwImg; // ilHwImg to operate on
ilHwContext* ctx; // copy of fbImg ilHwContext
int bufferEnables;
private:
ilHwBarrier* forceBarrier; // forced barrier when parent has no barrier
};
// ilHwSwapMgr implements a swap buffer operation
class ilHwSwapMgr : public ilHwManager {
public:
ilHwSwapMgr(ilFrameBufferImg* img, ilMpNode* parent);
};
// ilHwFillMgr implements the fill operation. An image tile in the
// ilFrameBufferImg (fbImg) is filled with an RGB value. A fill request
// will be constructed and linked in for every fbImg page that intersects
// the specified tile.
//
class ilHwFillMgr : public ilHwManager {
public:
// Specify tile to fill, (x,y) to (x+nx,y+ny), in fbImg with specified
// red:green:blue value.
//
ilHwFillMgr(ilFrameBufferImg* img, ilMpNode* parent, int x, int y,
int nx, int ny, float red, float green, float blue,
int bufferEnables);
};
// ilHwCallbackMgr implements a rendering callback for the specified frame
// buffer image from the graphics thread. The OpenGL context of the drawable
// (if any) will be made current before the callback is called. It is the
// responsibility of the callback to setup any graphics state it needs and
// restore it before returning.
//
class ilHwCallbackMgr : public ilHwManager {
public:
// Specify a list of callbacks to 'prepare' for the rendering (called
// from a compute thread), do the actual 'render'ing (called from the
// graphics thread), and finally do any 'finish'ing cleanup (called
// from a compute thread). The prepare and/or finish callback lists may
// be NULL. The caller arg will be passed to each of the callbacks invoked.
//
ilHwCallbackMgr(ilHwImg* img, ilMpNode* parent,
ilCallback* prepare, ilCallback* render,
ilCallback* finish, void* callerArg);
};
// ilHwRequest is the base class for requests that will be destined for
// the graphics queue. The main function of this base class is to ensure
// an accurate count of graphics requests on an ilHwBarrier.
class ilHwRequest : public ilMpRequest {
public:
virtual ~ilHwRequest();
// notify of graphics request completion
void graphicsDone()
{ getHwBarrier()->graphicsDone(); didNotify = TRUE; }
int getResQuantum() { return resQuantum; }
void setResQuantum(int q) { resQuantum = q; }
protected:
ilHwRequest(ilMpManager* parent, ilMpState initialState=ilMpGraphics)
: ilMpRequest(parent, initialState)
{ init(); }
ilHwRequest(ilHwRequest* sibling)
: ilMpRequest(sibling)
{ init(); }
private:
void init();
int resQuantum; // resource quantum used by ilHwResource allocation
int didNotify; // checkSwap must be called even if we are aborted
};
#endif